home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PsL Monthly 1993 December
/
PSL Monthly Shareware CD-ROM (December 1993).iso
/
prgmming
/
dos
/
asm
/
cm_int.exe
/
CM-INT.DOC
< prev
next >
Wrap
Text File
|
1993-04-10
|
16KB
|
334 lines
;------------------
; CM-INT -- Interrupt Service by CMartin -- 2/22/92
; Member ASP; CompuServe 72130,1400
; The Program CM-INT is released as Freeware. No contribution is expected.
;------------------
; Intended as a tool kit for 80x86 Assembly Language programmers, this
; service may also be useful to high level language programmers whose
; language gives them access to the 80x86 interrupt architecture.
; This interrupt service installs and stays resident, by including the
; command CM-INT in autoexec.bat, and CM-INT.COM in root directory, or by
; running CM-INT before any programs that use this interrupt service.
; The functions in this service preserve the general purpose registers not
; used for data transfer. They also preserve the segment, index and base
; pointer registers.
;
; This service is accessed via Int 0C0h, with function number passed through
; bh. Description of each function follows:
;------------------
;
; PAUSE
; Function 00h: Pause until specific key is pressed.
; Entry: bl - ASCII code of keypress required to
; release pause
; bh - 00h
; Return: None
;------------------
;
; PRINT
; Function 01h: Print string at current cursor position.
; Entry: ds:si - pointer to ASCIIZ source string
; bh - 01h
; Return: None
;------------------
;
; INPUT
; Function 02h: Input a string from keyboard at current cursor position
; Entry: ds:si - pointer to destination string
; bh - 02h
; Return: None
;------------------
;
; SCAN (INPUT TO SCREEN) WITH PROMPT AND EDIT
; Function 03h: Scan with prompt and editing at current cursor position
; Entry: ds:si - pointer to ASCIIZ prompt string
; ds:di - pointer to ASCIIZ destination string for
; data being entered/edited
; al - data length - desired length of entry string
; ah - data type - 0:no filtering
; 1:filter non-printable
; 2:numbers (0-9),blanks,and '+-'
; 3:numbers,blanks,and 'eE+-'
; 4:dates (0-9,'/-' and blank)
; bl - 0=upper and lower case, >0=lower converted to
; upper
; cl - blank option- 0:no stripping
; 1:strip leading blanks
; 2:strip trailing blanks
; 3:strip both leading and trailing
; ch - data window color (prompt field color is same
; backgnd as orig scrn attr, with hi intensity
; white foregnd. On exit, orig scrn attr are
; restored in all fields)
; bl - 0:Upper and lower case; >0:Converts to upper
; bh - 03h
; Return: bl - ASCII char code describing which keypress
; terminated data entry. A number of termination
; key combinations with corresponding codes are
; built in for versatility, and are all
; available. The returned byte ASCII character,
; the key combo that produces it, and the
; suggested usage follows:
;
; 'I'-<Ctrl><Rtn> {In} 'O'-<Ctrl><F10>-Delete block {Out}
; 'D'-Down arrow 'U'-Up arrow
; 'A'-<PgUp> 'Z'-<PgDn>
; 'N'-<Ctrl>N-Insert New line 'Y'-<Ctrl>Y-Delete line
; 'L'-<Ctrl>L-Move Col Left 'R'-<Ctrl>R-Move Column Right
; 'C'-<Rtn> {Carriage} 'E'-<Esc>
; 'X'-Error - prompt plus data > 4 lines or off bottom of screen
;------------------
;
; LINE PRINT
; Function 04h: Print to parallel port printer
; Entry: ds:si - pointer to string to be printed
; cx - -1 means string is ASCIIZ and is to be printed
; up to the terminal NULL
; Number other than -1 means print that number of
; characters. (Permits 0 as a print control
; character.)
; bh - 04h
; Returns: If print terminated by <Esc>, then leaves keypress in
; keyboard buffer, accessible by int 16h, func 1
;------------------
;
; 32-BIT NUMBER TO ASCIIZ
; Function 06h: 32-bit binary number to ASCIIZ string
; Entry: dx:ax - 32-bit signed binary number to be converted
; ds:si - pointer to ASCIIZ destination string
; bl - format for string:
; 0=decimal,1=hex,2=octal,3=binary
; bh - 03h
; Returns: None
;------------------
;
; ASCIIZ TO 32-BIT NUMBER
; Function 07h: ASCIIZ string to 32-bit signed number
; Operation: Function scans from rightmost byte in string until
; beginning of field, ignoring illegal characters.
; Terminal h or H means hex;o or O octal; b or B bin
; Entry: ds:si - pointer to ASCIIZ source string
; bh - 04h
; Returns: dx:ax - 32-bit signed binary number (0:0 for overflow)
; bl = 0 (normal return), -1 (overflow)
;------------------
;
; JULIAN TO CALENDAR DATE
; Function 10h: Convert julian date to calendar date.
; Operation: Julian date is sent in on ax as unsigned 16-bit
; binary number, where julian date 1=calendar date 1/1/1901.
; Julian date <1 or >36525 (earlier that 1/1/1901 or later
; that 12/31/2000 [12/31/00]) are illegal
; Normalized calendar date (mm/dd/yy) is copied as ASCIIZ
; string at the pointer provide by ds:si. If julian date
; is in illegal range, the string ' / / ' is copied.
; In addition, the day of the week is returned as a number
; 0-7 through bh (0=illegal,1=Sunday,etc.).The century
; prefix (e.g., 19 for 1956) is passed through bl.
; Entry: bl - century prefix
; (e.g., 19 is century prefix for 1978)
; ax - julian date (unsigned 16-bit) (1=01/01/01)
; cx - number of digits to display year (2 or 4),
; if century prefix is 19.
; (If century prefix not 19, 4 digits will be
; displayed, regardless of contents of cx)
; ds:si - pointer to ASCIIZ destination string where
; calendar date is to be copied (11 bytes min)
; bh - 10h
; Return: ax - julian date as unsigned 16-bit number
; (0 if illegal)
; bl - century prefix
; bh - day of week (0=illegal,1=Sunday,etc.)
; cx - year (1980-2099) (as expected by system set
; dh - month (1-12) date service int 21h, 2Bh)
; dl - day (1-31)
;------------------
;
; CALENDAR TO JULIAN DATE
; Function 11h: Convert calendar date to julian date
; Operation: Converse of Function 10h, except that calendar
; date string is normalized to 9-byte or 11-byte ASCIIZ form
; (mm/dd/yy+terminal NULL or mm/dd/yyyy+NULL, depending on
; whe